package com.spring.boot.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.sql.Array;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * 用户表
 *
 * @author 刘骄阳
 * 2021-07-14 10:16
 */
@TableName("users")
public class Users {
    /**
     * id
     */
    @TableId("id")
    private Integer id;

    /**
     * 用户名
     */
    @TableField("username")
    private String username;

    /**
     * 昵称
     */
    @TableField("nick_name")
    private String nickName;

    /**
     * 密码
     */
    @TableField("password")
    private String password;

    /**
     * 好友
     */
    @TableField("friends")
    private String friends;

    /**
     * 头像
     */
    @TableField("hearImg")
    private String hearImg;

    /**
     * 屏蔽
     */
    @TableField("shield")
    private String shield;

    /**
     * role角色
     */
    @TableField(value = "role", exist = false)
    private String role;

    /**
     * authority权限
     */
    @TableField(value = "authority", exist = false)
    private ArrayList<String> authority;

    /**
     * 最后登录时间
     */
    @TableField("last_login_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastLoginTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getFriends() {
        return friends;
    }

    public void setFriends(String friends) {
        this.friends = friends;
    }

    public String getHearImg() {
        return hearImg;
    }

    public void setHearImg(String hearImg) {
        this.hearImg = hearImg;
    }

    public String getShield() {
        return shield;
    }

    public void setShield(String shield) {
        this.shield = shield;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public ArrayList<String> getAuthority() {
        return authority;
    }

    public void setAuthority(ArrayList<String> authority) {
        this.authority = authority;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    @Override
    public String toString() {
        return "Users{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", nickName='" + nickName + '\'' +
                ", password='" + password + '\'' +
                ", friends='" + friends + '\'' +
                ", hearImg='" + hearImg + '\'' +
                ", shield='" + shield + '\'' +
                ", role='" + role + '\'' +
                ", authority=" + authority +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }
}
